package com.itheima01;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class SanZhongBianLi {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("javaee");
        list.add("javase");
        list.add("javame");
        list.add("javaee");
        Iterator<String> iter = list.iterator();
        System.out.println("迭代器");
        while (iter.hasNext()) {
            String next = iter.next();
            System.out.println(next);
        }
        System.out.println("增强for");
        for (String s : list) {
            System.out.println(s);
        }
        System.out.println("lambda");
        list.forEach(s-> System.out.println(s));
    }
}
